Đặt vé xe buýt trực tuyến bằng PHP / MySQLi
1 <?php
2 //Start session
3 session_start();
4
5 //Unset the variables stored in session
6 unset($_SESSION['SESS_MEMBER_ID']);
7 ?>
8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
9 <html xmlns="http://www.w3.org/1999/xhtml">
10 <head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12 <title>Welcome to James Buchanan Pub and Restaurant</title>
13 <link rel="stylesheet" type="text/css" href="xres/css/style.css" />
14 <link rel="icon" type="image/png" href="xres/images/favicon.png" />
15 <!--[if IE 6]><style type="text/css"> * html img { behavior: url("xres/iepngfix.htc") }</style><![endif]-->
16 <script type="text/javascript" src="xres/js/saslideshow.js"></script>
17 <script type="text/javascript" src="xres/js/slideshow.js"></script>
18 <script src="js/jquery-1.5.min.js" type="text/javascript" charset="utf-8"></script>
19 <script src="vallenato/vallenato.js" type="text/javascript" charset="utf-8"></script>
20 <link rel="stylesheet" href="vallenato/vallenato.css" type="text/css" media="screen" charset="utf-8">
21
22 <script type="text/javascript">
23 $("#slideshow > div:gt(0)").hide();
24
25 setInterval(function() {
26 $('#slideshow > div:first')
27 .fadeOut(1000)
28 .next()
29 .fadeIn(1000)
30 .end()
31 .appendTo('#slideshow');
32 }, 3000);
33 </script>
34 <!--sa calendar-->
35 <script type="text/javascript" src="js/datepicker.js"></script>
36 <link href="css/demo.css" rel="stylesheet" type="text/css" />
37 <link href="css/datepicker.css" rel="stylesheet" type="text/css" />
38 <script type="text/javascript">
39 //<![CDATA[
40
41 /*
42 A "Reservation Date" example using two datePickers
43 --------------------------------------------------
44
45 * Functionality
46
47 1. When the page loads:
48 - We clear the value of the two inputs (to clear any values cached by the browser)
49 - We set an "onchange" event handler on the startDate input to call the setReservationDates function
50 2. When a start date is selected
51 - We set the low range of the endDate datePicker to be the start date the user has just selected
52 - If the endDate input already has a date stipulated and the date falls before the new start date then we clear the input's value
53
54 * Caveats (aren't there always)
55
56 - This demo has been written for dates that have NOT been split across three inputs
57
58 */
59
60 function makeTwoChars(inp) {
61 return String(inp).length < 2 ? "0" + inp : inp;
62 }
63
64 function initialiseInputs() {
65 // Clear any old values from the inputs (that might be cached by the browser after a page reload)
66 document.getElementById("sd").value = "";
67 document.getElementById("ed").value = "";
68
69 // Add the onchange event handler to the start date input
70 datePickerController.addEvent(document.getElementById("sd"), "change", setReservationDates);
71 }
72
73 var initAttempts = 0;
74
75 function setReservationDates(e) {
76 // Internet Explorer will not have created the datePickers yet so we poll the datePickerController Object using a setTimeout
77 // until they become available (a maximum of ten times in case something has gone horribly wrong)
78
79 try {
80 var sd = datePickerController.getDatePicker("sd");
81 var ed = datePickerController.getDatePicker("ed");
82 } catch (err) {
83 if(initAttempts++ < 10) setTimeout("setReservationDates()", 50);
84 return;
85 }
86
87 // Check the value of the input is a date of the correct format
88 var dt = datePickerController.dateFormat(this.value, sd.format.charAt(0) == "m");
89
90 // If the input's value cannot be parsed as a valid date then return
91 if(dt == 0) return;
92
93 // At this stage we have a valid YYYYMMDD date
94
95 // Grab the value set within the endDate input and parse it using the dateFormat method
96 // N.B: The second parameter to the dateFormat function, if TRUE, tells the function to favour the m-d-y date format
97 var edv = datePickerController.dateFormat(document.getElementById("ed").value, ed.format.charAt(0) == "m");
98
99 // Set the low range of the second datePicker to be the date parsed from the first
100 ed.setRangeLow( dt );
101
102 // If theres a value already present within the end date input and it's smaller than the start date
103 // then clear the end date value
104 if(edv < dt) {
105 document.getElementById("ed").value = "";
106 }
107 }
108
109 function removeInputEvents() {
110 // Remove the onchange event handler set within the function initialiseInputs
111 datePickerController.removeEvent(document.getElementById("sd"), "change", setReservationDates);
112 }
113
114 datePickerController.addEvent(window, 'load', initialiseInputs);
115 datePickerController.addEvent(window, 'unload', removeInputEvents);
116
117 //]]>
118 </script>
119 <style>
120 img.logo {
121 left: 216px;
122 }
123 </style>
124
125 </head>
126
127 <body>
128 <div id="wrapper">
129 <div id="header">
130 <h1><a href="index.php"><img src="xres/images/logo.png" class="logo" alt="James Buchanan Pub and Restaurant" /></a></h1>
131 <ul id="mainnav">
132 <li class="current"><a href="index.php">Home</a></li>
133 <li><a href="gallery.php">Gallery</a></li>
134 <li><a href="history.php">History</a></li>
135 <li><a href="routes.php">Routes</a></li>
136 <li><a href="location.php">location</a></li>
137 <li><a href="contact.php">Contact Us</a></li>
138 </ul>
139 </div>
140 <div id="content">
141 <div id="rotator">
142 <ul>
143 <li class="show"><img src="xres/images/jb2/01.jpg" width="861" height="379" alt="" /></li>
144 <li><img src="xres/images/jb2/02.jpg" width="861" height="379" alt="" /></li>
145 <li><img src="xres/images/jb2/03.jpg" width="861" height="379" alt="" /></li>
146 <li><img src="xres/images/jb2/04.jpg" width="861" height="379" alt="" /></li>
147 </ul>
148
149 <div id="logo" style="left: 600px; height: auto; top: 23px; width: 260px; position: absolute; z-index:4;">
150
151 <h2 class="accordion-header" style="height: 18px; margin-bottom: 15px; color: rgb(255, 255, 255); background: none repeat scroll 0px 0px rgb(53, 48, 48);">Ticket Booking</h2>
152 <div class="accordion-content" style="margin-bottom: 15px;">
153 <form action="selectset.php" method="post" style="margin-bottom:none;">
154 <span style="margin-right: 11px;">Select Route:
155 <select name="route" style="width: 191px; margin-left: 15px; border: 3px double #CCCCCC; padding:5px 10px;"/>
156 <?php
157 include('db.php');
158 $result = mysqli_query($conn,"SELECT * FROM route");
159 while($row = mysqli_fetch_array($result))
160 {
161 echo '<option value="'.$row['id'].'">';
162 echo $row['route'].' :'.$row['type'].' :'.date("h:i A",strtotime("2020-01-01 ".$row['time']));
163 echo '</option>';
164 }
165 ?>
166 </select>
167 </span><br>
168 <span style="margin-right: 11px;">Date:
169 <input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="date" id="sd" value="" maxlength="10" readonly="readonly" style="width: 165px; margin-left: 15px; border: 3px double #CCCCCC; padding:5px 10px;"/>
170 </span><br>
171 <span style="margin-right: 11px;">No. of Passenger:
172 <select name="qty" style="width: 191px; margin-left: 15px; border: 3px double #CCCCCC; padding:5px 10px;">
173 <option>1</option>
174 <option>2</option>
175 <option>3</option>
176 <option>4</option>
177 <option>5</option>
178 <option>6</option>
179 <option>7</option>
180 <option>8</option>
181 <option>9</option>
182 </select>
183 </span><br><br>
184 <input type="submit" id="submit" value="Next" style="height: 34px; margin-left: 15px; width: 191px; padding: 5px; border: 3px double rgb(204, 204, 204);" />
185 </form>
186 </div>
187 <h2 class="accordion-header" style="height: 18px; margin-bottom: 15px; color: rgb(255, 255, 255); background: none repeat scroll 0px 0px rgb(53, 48, 48);">Admin Login</h2>
188 <div class="accordion-content" style="margin-bottom: 15px;">
189 <form action="login.php" method="post" style="margin-bottom:none;">
190 <span style="margin-right: 11px;">Username: <input type="text" name="username" style="width: 165px; margin-left: 15px; border: 3px double #CCCCCC; padding:5px 10px;"/></span><br>
191 <span style="margin-right: 11px;">Password: <input type="password" name="password" style="width: 165px; margin-left: 15px; border: 3px double #CCCCCC; padding:5px 10px;"/></span><br><br>
192 <input type="submit" id="submit" class="medium gray button" value="Login" style="height: 34px; margin-left: 15px; width: 191px; padding: 5px; border: 3px double rgb(204, 204, 204);" />
193 </form>
194 </div>
195 </div>
196 </div>
197
198 </div>
199 <div id="featured">
200 <div id="items">
201 <div class="item"> <a href="main-course.php"><img src="xres/images/01_featured.jpg" alt="" /></a>
202 <h3><a href="main-course.php">Specials Offers</a></h3>
203 <p><a href="#"><strong>Aircon Bus</strong><br />
204 Come in and experience<br /> Our
205 new Bus Type<br /> specials today!</a></p>
206 </div>
207 <div class="item"> <a href="lodging.php"><img src="xres/images/02_featured.jpg" alt="" /></a>
208 <h3><a href="lodging.php">New Route</a></h3>
209 <p><a href="lodging.php"><strong>From ble to bla Vice versa</strong><br />
210 Spend a relaxing evening in our circa 1796 hotel, steeped in history. </a></p>
211 </div>
212 <div class="item" style="width: 860px;">
213 <iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FFlorida-Bus%2F224961217554604%3Fref%3Dts%26fref%3Dts&width=800&height=290&show_faces=true&colorscheme=dark&stream=false&border_color&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:800px; height:290px;" allowTransparency="true"></iframe>
214 </div>
215 </div>
216 </div>
217
218 <div id="footer">
219 <h4>+63(2)3525393 • <a href="contact-us.php">Barangay West Kamias, Cubao, Quezon City, Metro Manila </a></h4>
220 <p>Hours of Operation • Mon - Sun: 10:00 am - 12:00 am</p>
221 <a href="index.php"><img src="xres/images/footer-logo.jpg" alt="James Buchanan Pub and Restaurant" /></a>
222 <p>© Copyright 2013 Florida Bus | All Rights Reserved <br /></p>
223 </div>
224 </div>
225 </body>
226 </html>